<layout name="layout_admin" />
<div class="pageheader notab">
	<h1 class="pagetitle" id="campaign_title">管理员登陆</h1>
</div> 
<div id="contentwrapper" class="contentwrapper">
	<div>
		<form id="admin_info" action="/admin/login" method="post" onsubmit="return false;">
			<div>
				<label class="frm_lbl">帐号 : </label>
				<input value="" id="admin_nick" type="text" name="nick"  style="width:150px;" />
			</div>
			<div>
				<label class="frm_lbl">密码 : </label>
				<input class="" id="admin_pass" type="password"  name="password" value="" maxlength="45" />
			</div>
			<div>
				<label class="frm_lbl"></label>
				<input type="submit" class="newfilebutton" id="loginadmin" style="width:50px;" value="登陆" />
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$(function() {
		function submitLogin() {
			var $btn = $(this);
			$btn.disabled();
			//var data = $("#admin_info").serialize();
			var data = {
				nick: $("#admin_nick").val(),
				password: $("#admin_pass").val()
			};
			wt.post('/admin/login', data, function(r) {
				var o = $.parseJSON(r);
				wt.showNotice(o.data.info, true);
				if (o.data.result) {
					window.location.href = '/admin/member';
				} else {
					$btn.recover();
				}
			});
			return false;
		}
		$("#loginadmin").on('click', submitLogin);
		$('#pass').focus();
	});
</script>